﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net.NetworkInformation;
using System.Net;

namespace KTDS_TELNET_CHECK
{
    class C_Telnet
    {
        public bool CheckTheTelnet(string IpInfo, int PortInfo)
        {
            TcpClient TcpScan = new TcpClient();

            try
            {
                TcpScan.SendTimeout = 1;
                TcpScan.SendBufferSize = 10;
                TcpScan.ReceiveTimeout = 1;
                TcpScan.ReceiveBufferSize = 10;
                TcpScan.NoDelay = true;

                TcpScan.Connect(IpInfo, PortInfo);

                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
